鼠标点击进度条,实时改变窗体透明度
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace 透明度调节
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int transparent = 0;//透明度
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
panel2.Size = new Size(e.Location.X, 13);
transparent = e.Location.X;
ChangeTransparent(transparent);
label1.Text = transparent.ToString() "%";
评论